package mysql

import "gorm.io/gorm"

type System struct {
	gorm.Model
	UserId       int64   `gorm:"type:int;comment:用户id"`
	SystemName   string  `gorm:"type:varchar(50);comment:名称"`
	SystemCover  string  `gorm:"type:varchar(200);not null;comment:封面"`
	Price        float64 `gorm:"type:decimal(10,2);default:0.00;comment:价格"`
	SystemStatus int64   `gorm:"type:tinyint(1);default:1;comment:状态:1:待出售,2:通过,3:不通过"`
}

func (s *System) SystemInfo(systemId int64) error {
	return Db.Where("id = ?", systemId).Limit(1).Find(&s).Error
}
